<?php
/*
 * @Author: 李志刚
 * @CopyRight: 2020-2030 衡水山木枝技术服务有限公司
 * @Date: 2021-10-19 10:18:39
 * @Description: 门店员工，在创建门店时默认创建超管员工
 * @LastEditors: 李志刚
 * @LastEditTime: 2021-10-20 09:20:24
 * @FilePath: /归档/user/2021_10_19_101839_create_shop_user.php
 */

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateShopUser extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('shop_users', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->id();
            $table->foreignId('shop_id')->default(0)->comment('店铺ID');
            $table->string('name', 50)->comment('名称');
            $table->string('password', 255)->comment('密码');
            $table->char('crypt', 10)->comment('加密串');
            $table->char('phone', 11)->comment('手机号');
            $table->ipAddress('lastip')->nullable()->default('0.0.0.0')->comment('最后登录 IP');
            $table->dateTime('lasttime')->useCurrent()->comment('最后登录时间');
            $table->boolean('status')->default(1)->comment('状态，1 正常，0 禁用');
            $table->tinyInteger('del_flag')->default(0)->comment('删除状态，1 删除，0 未删除');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('shop_users');
    }
}
